<?php
if ($this->paginator->pageCount > 1) {
    $params = '';
    if (isset($this->params)) {
        foreach ($this->params as $key => $value) {
            $params .= '/' . $key . '/' . $value;
        }
    }
    ?>

    <div class="paginationControl">
        <ul>
            <?php if (isset($this->paginator->previous)): ?>
                <li class="paginationFirst"><a href="<?php echo ADMIN_URL . $this->url . '/page/' . $this->paginator->first . $params; ?>">
                        <?php echo $this->t->_('First') ?>
                    </a></li>
            <?php else: ?>
                <li class="paginationFirst"><span class="disabled"><?php echo $this->t->_('First') ?></span></li>
            <?php endif; ?>
                
            <?php if (isset($this->paginator->previous)): ?>
                <li class="paginationPrevious"><a href="<?php echo ADMIN_URL . $this->url  . '/page/' . $this->paginator->previous . $params; ?>">
                        <?php echo $this->t->_('Previous') ?>
                    </a></li>
                <?php else: ?>
                <li class="paginationPrevious"><span class="disabled"><?php echo $this->t->_('Previous') ?></span></li>
            <?php endif; ?>
                
            <?php foreach ($this->paginator->pagesInRange as $page): ?>
                <?php if ($page != $this->paginator->current): ?>
                    <li class="paginationPage"><a href="<?php echo ADMIN_URL . $this->url  . '/page/' . $page . $params; ?>">
                            <?php echo $page; ?>
                        </a></li>
                <?php else: ?>
                    <li class="paginationPage"><span class="current"><?php echo $page; ?></span></li>
                <?php endif; ?>
            <?php endforeach; ?>
                    
            <?php if (isset($this->paginator->next)): ?>
                <li class="paginationNext"><a href="<?php echo ADMIN_URL . $this->url  . '/page/' . $this->paginator->next . $params; ?>">
                        <?php echo $this->t->_('Next') ?>
                    </a></li>
            <?php else: ?>
                <li class="paginationNext"><span class="disabled"><?php echo $this->t->_('Next') ?></span></li>
            <?php endif; ?>
                
            <?php if (isset($this->paginator->next)): ?>

                <li class="paginationLast"><a href="<?php echo ADMIN_URL . $this->url  . '/page/' . $this->paginator->last . $params; ?>">
                        <?php echo $this->t->_('Last') ?>
                    </a></li>
            <?php else: ?>
                <li class="paginationLast"><span class="disabled"><?php echo $this->t->_('Last') ?></span></li>
                <?php endif; ?>
        </ul><div class="clearfix"></div></div>
        
<?php } ?>
